using System;
using System.Collections.Generic;
using System.Text;
using SdlDotNet.Graphics.Sprites;
using System.Drawing;
using System.Collections;

namespace SnakeCharp.Entity
{
    public class SnakeTailNode : Sprite
    {
        private Queue<Point> positionQueue;
        private bool isMoving;

      
        #region Constructors

        public SnakeTailNode(Point position)
            : base(Configurations.ImagePath + "Snake_TailPart.png")
        {
            this.Center = position;
            this.positionQueue = new Queue<Point>();
            this.isMoving = false;
        } 

        #endregion

        public void Update()
        {
            this.Center = positionQueue.Dequeue();
        }

        public Queue<Point> CopyOfQueue()
        {
            Queue<Point> newQueue = new Queue<Point>();

            foreach (Point p in this.positionQueue)
            {
                newQueue.Enqueue(p);
            }

            return newQueue;
        }

        #region Properties

        public Queue<Point> PositionQueue
        {
            get { return positionQueue; }
            set { positionQueue = value; }
        }

        public bool IsMoving
        {
            get { return isMoving; }
            set { isMoving = value; }
        }
        #endregion
    }
}
